
export interface ProxyProps {
  api?: string;
  target?: string;
  changeOrigin?: boolean;
  pathRewrite?: any;
  ws?: boolean,
}

export function getProxy(props: ProxyProps) {
  const e = {};
  e[`${props.api}`] = {
    target: props.target,
    changeOrigin: props.changeOrigin || true,
    pathRewrite: props.pathRewrite || { '^': '' },
    ws: props.ws ?? false,
  };
  return e;
}